﻿<Window x:Class="WozLib.UI.Dialogs.TextMessageDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Alert!" 
    WindowStyle="SingleBorderWindow" 
    WindowStartupLocation="CenterOwner" 
    ResizeMode="NoResize" 
    ShowInTaskbar="True" 
    SizeToContent="WidthAndHeight"
    x:Name="_TextMessageDialog"
    >
  <Grid>
    <StackPanel Orientation="Horizontal" Margin="10">
      <Canvas Width="100" Height="100">
        <Canvas Width="200" Height="100" Canvas.Left="300" Canvas.Top="-15">
          <Ellipse Width="15" Height="30" Stroke="Black" StrokeThickness="3.5" Canvas.Left="85" Canvas.Top="10"/>
          <Ellipse Width="20" Height="30" Stroke="Black" StrokeThickness="3.5" Canvas.Left="50" Canvas.Top="8"/>
          <Ellipse Width="100" Height="28" Stroke="Black" Fill="White" StrokeThickness="3.5" Canvas.Top="20"/>
          <Ellipse Width="20" Height="35" Stroke="Black" Fill="White" StrokeThickness="3.5" Canvas.Left="50" Canvas.Top="28"/>
          <Polygon Points="30,25 60,28 60,40 30,40" Fill="White" Canvas.Left="15" Canvas.Top="0"/>
          <Ellipse Width="15" Height="6" Stroke="Black" StrokeThickness="0.8" Canvas.Left="5" Canvas.Top="28"/>
          <Ellipse Width="5" Height="8" Stroke="Black" StrokeThickness="0.8" Canvas.Left="30" Canvas.Top="28"/>
          <Ellipse Width="5" Height="8" Stroke="Black" StrokeThickness="0.8" Canvas.Left="38" Canvas.Top="28"/>
          <Ellipse Width="5" Height="8" Stroke="Black" StrokeThickness="0.8" Canvas.Left="46" Canvas.Top="28"/>
          <Ellipse Width="5" Height="8" Stroke="Black" StrokeThickness="0.8" Canvas.Left="54" Canvas.Top="28"/>
          <Ellipse Width="5" Height="8" Stroke="Black" StrokeThickness="0.8" Canvas.Left="62" Canvas.Top="28"/>
          <Ellipse Width="5" Height="8" Stroke="Black" StrokeThickness="0.8" Canvas.Left="70" Canvas.Top="28"/>
          <Ellipse Width="5" Height="8" Stroke="Black" StrokeThickness="0.8" Canvas.Left="78" Canvas.Top="28"/>
          <Canvas.RenderTransform>
            <TranslateTransform x:Name="PlaneTran" X="0" Y="0"/>
          </Canvas.RenderTransform>
        </Canvas>
        <Canvas Width="100" Height="100">
          <Canvas.RenderTransform>
            <TranslateTransform x:Name="TriTran" X="0" Y="0"/>
            <!--<RotateTransform x:Name="TriRot" Angle="0" CenterX="50" CenterY="50" />-->
          </Canvas.RenderTransform>
          <Polygon Points="0,50 30,0, 60,50" Stroke="Black" Canvas.Left="20" Canvas.Top="25">
            <Polygon.Fill>
              <LinearGradientBrush>
                <LinearGradientBrush.GradientStops>
                  <GradientStop Offset="1" Color="Yellow"/>
                  <GradientStop Offset="0" x:Name="TriangleColorStop" Color="Gray"/>
                </LinearGradientBrush.GradientStops>
              </LinearGradientBrush>
            </Polygon.Fill>
          </Polygon>
          <TextBlock Text="!" FontFamily="Comic Sans" FontSize="40" Canvas.Left="43" Canvas.Top="33"/>
          <Canvas.Triggers>
            <EventTrigger RoutedEvent="Canvas.Loaded">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard BeginTime="0:0:0" >
                    <ColorAnimation BeginTime="0:0:3.0" Storyboard.TargetName="TriangleColorStop" RepeatBehavior="Forever" Storyboard.TargetProperty="Color" To="Yellow" Duration="0:0:0.75" AutoReverse="True" From="Gray">
                    </ColorAnimation>
                    <DoubleAnimation To="-450" AccelerationRatio="0.3"  Duration="0:0:2.5" Storyboard.TargetName="PlaneTran" Storyboard.TargetProperty="X"/>
                  </Storyboard>
                </BeginStoryboard>
                <BeginStoryboard>
                  <Storyboard BeginTime="0:0:1.5" AccelerationRatio="0.5">
                    <!--<DoubleAnimation From="0" To="360" Duration="0:0:1" RepeatBehavior="Forever"  Storyboard.TargetName="TriRot" Storyboard.TargetProperty="Angle"/>-->
                    <DoubleAnimation From="0" To="35" AccelerationRatio="0.5" Duration="0:0:0.2" Storyboard.TargetName="TriTran" Storyboard.TargetProperty="Y"/>
                    <DoubleAnimation From="35" To="15" DecelerationRatio="0.5" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="TriTran" Storyboard.TargetProperty="Y"/>
                    <DoubleAnimation From="15" To="35" AccelerationRatio="0.5" BeginTime="0:0:0.4" Duration="0:0:0.2" Storyboard.TargetName="TriTran" Storyboard.TargetProperty="Y"/>
                    <DoubleAnimation From="35" To="25" DecelerationRatio="0.5" BeginTime="0:0:0.6" Duration="0:0:0.2" Storyboard.TargetName="TriTran" Storyboard.TargetProperty="Y"/>
                    <DoubleAnimation From="25" To="35" AccelerationRatio="0.5" BeginTime="0:0:0.8" Duration="0:0:0.2" Storyboard.TargetName="TriTran" Storyboard.TargetProperty="Y"/>
                    <DoubleAnimation From="35" To="30" DecelerationRatio="0.5" BeginTime="0:0:1.0" Duration="0:0:0.2" Storyboard.TargetName="TriTran" Storyboard.TargetProperty="Y"/>
                    <DoubleAnimation From="30" To="35" AccelerationRatio="0.5" BeginTime="0:0:1.2" Duration="0:0:0.2" Storyboard.TargetName="TriTran" Storyboard.TargetProperty="Y"/>
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
          </Canvas.Triggers>
        </Canvas>
      </Canvas>
      <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10">
        <Grid.RowDefinitions>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" x:Name="_MessageTextBlock" Text="Alert!" Margin="5" HorizontalAlignment="Center" />
        <Button Grid.Row="1" x:Name="_OkButton" Click="OkButtonHandler" Margin="5" HorizontalAlignment="Center">
          <TextBlock x:Name="_OkButtonTextBlock" Text="OK"/>
        </Button>
      </Grid>
    </StackPanel>
  </Grid>
</Window>
